home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / code_lib / objlibr / objlib12 / sample3 / form1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-10-10  |  3.7 KB  |  135 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Form1"
  5.    ClientHeight    =   6180
  6.    ClientLeft      =   1110
  7.    ClientTop       =   1485
  8.    ClientWidth     =   5040
  9.    Height          =   6585
  10.    Left            =   1050
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   6180
  13.    ScaleWidth      =   5040
  14.    Top             =   1140
  15.    Width           =   5160
  16.    Begin PictureBox List 
  17.       Height          =   3075
  18.       Left            =   330
  19.       ScaleHeight     =   203
  20.       ScaleMode       =   3  'Pixel
  21.       ScaleWidth      =   223
  22.       TabIndex        =   4
  23.       Top             =   2370
  24.       Width           =   3375
  25.    End
  26.    Begin PictureBox loader 
  27.       AutoRedraw      =   -1  'True
  28.       AutoSize        =   -1  'True
  29.       BackColor       =   &H00C0C0C0&
  30.       BorderStyle     =   0  'None
  31.       Height          =   480
  32.       Left            =   240
  33.       ScaleHeight     =   480
  34.       ScaleWidth      =   480
  35.       TabIndex        =   3
  36.       Top             =   990
  37.       Visible         =   0   'False
  38.       Width           =   480
  39.    End
  40.    Begin PictureBox defaulticon 
  41.       AutoRedraw      =   -1  'True
  42.       AutoSize        =   -1  'True
  43.       BorderStyle     =   0  'None
  44.       Height          =   480
  45.       Left            =   240
  46.       Picture         =   FORM1.FRX:0000
  47.       ScaleHeight     =   32
  48.       ScaleMode       =   3  'Pixel
  49.       ScaleWidth      =   32
  50.       TabIndex        =   2
  51.       Top             =   1530
  52.       Visible         =   0   'False
  53.       Width           =   480
  54.    End
  55.    Begin PictureBox pics 
  56.       AutoRedraw      =   -1  'True
  57.       AutoSize        =   -1  'True
  58.       BackColor       =   &H00FFFFFF&
  59.       BorderStyle     =   0  'None
  60.       Height          =   480
  61.       Left            =   0
  62.       Picture         =   FORM1.FRX:0302
  63.       ScaleHeight     =   32
  64.       ScaleMode       =   3  'Pixel
  65.       ScaleWidth      =   160
  66.       TabIndex        =   1
  67.       Top             =   0
  68.       Visible         =   0   'False
  69.       Width           =   2400
  70.    End
  71.    Begin VScrollBar vs 
  72.       Height          =   2772
  73.       LargeChange     =   2
  74.       Left            =   2995
  75.       Max             =   2
  76.       TabIndex        =   0
  77.       Top             =   0
  78.       Width           =   264
  79.    End
  80. Option Explicit
  81. Dim loading%
  82. 'structure holding the data for
  83. 'for this window's listbox
  84. Dim ld As LISTDATA
  85. 'this array holds the items in the list
  86. Dim items() As ITEMDATA
  87. Sub Form_Load ()
  88. Dim i%, x%
  89. ReDim items(0 To 40)
  90. For i = 0 To 40
  91.     items(i).text = "Item " & Format$(i)
  92.     x = i Mod 5
  93.     items(i).pic = x
  94.     'Debug.Print x
  95.     'Debug.Print items(i).text
  96. End Sub
  97. Sub Form_Resize ()
  98. 'do whatever this instance requires
  99. List.Move 120, 120, scalewidth - vs.Width - 240, scaleheight - 240
  100. vs.Move List.Width + 120 - screen.TwipsPerPixelX, 120, vs.Width, List.Height
  101. 'call the module
  102. ResizeList Me, ld, List
  103. End Sub
  104. Sub Init ()
  105. nl$ = Chr$(13) + Chr$(10)
  106. 'fill in the structure for this instance
  107. 'size of an item
  108. ld.cellheight = 32
  109. ld.cellwidth = List.Width
  110. 'size of the bitmap
  111. ld.picx = 0: ld.picy = 0
  112. ld.picwidth = 32
  113. ld.picheight = 32
  114. 'location of text with the cell
  115. ld.textrect.left = 40
  116. ld.textrect.top = 8
  117. 'number of items
  118. ld.itemcount = 40
  119. InitializeList ld, List
  120. End Sub
  121. Sub List_MouseDown (Button As Integer, Shift As Integer, x As Single, Y As Single)
  122. ItemClick Me, ld, items(), x, Y, List
  123. End Sub
  124. Sub List_Paint ()
  125. If Not loading% Then PaintList ld, items(), pics, List
  126. End Sub
  127. Sub vs_Change ()
  128. Dim n%
  129. n = (vs.Value)
  130. 'Debug.Print "toprow=" & n
  131. 'toprow range: 0=1st row,1=2nd, etc
  132. ld.toprow = n
  133. List_Paint
  134. End Sub
  135.